<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">

    <title>登录到JPress</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="#(CPATH)/static/front/jpressfront.css">
    <link rel="stylesheet" href="#(CPATH)/static/adminlte/css/adminlte.min.css">
    <link rel="stylesheet" href="#(CPATH)/static/components/fontawesome-free/css/all.min.css">

    <!--[if lt IE 9]>
    <script src="#(CPATH)/static/html5shiv/html5shiv.min.js"></script>
    <script src="#(CPATH)/static/respond/respond.min.js"></script>
    <![endif]-->
    <style>
        .login-page {
            background-image: url("#(CDN)#(CPATH)/static/commons/img/bg.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
        }
        .login-left{
            background-image: url("#(CDN)#(CPATH)/static/commons/img/login-img.png");
            background-size: cover;
            background-color:#409EFF;
        }
    </style>

</head>
<body class="hold-transition login-page">
<div class="login-content">
    <div class="login-left">
        <div class="login-logo2">JPress<span>®</span></div>
        <div class="login-bottom">
            <p>道阻且长，行则将至；</p>
            <p>念念不忘，必有回响。</p>
        </div>
    </div>
    <div class="login-right">

        <div class="login-box">
            <div class="login-logo" style="color: #333;font-size:2rem;font-weight:400;">
                登录网站管理系统
            </div>
            <!-- /.login-logo -->
            <div class="card">
                <div class="card-body login-card-body">

                    <form action="#(CPATH)#(action)" method="post" class="autoAjaxSubmit" data-ok-href="#(CPATH)/admin/index" data-fail-function="loginFail">

                        <div class="form-group">
                            <div class="login-input-content">
                                <input type="text" class="form-control" placeholder="请输入账号或邮箱" name="user" autocomplete="off"  required>
                                <span class="login-icon"><i class="fas fa-user"></i></span>

                            </div>

                        </div>

                        <div class="form-group">

                            <div class="login-input-content">
                                <input type="password" class="form-control" placeholder="及密码..." name="pwd" autocomplete="new-password" required>
                                <span class="login-icon"><i class="fas fa-key"></i></span>
                            </div>

                        </div>

                        #if(captchaEnable)
                        <div class="form-group">
                            <div style="display:flex;justify-content:space-between;">
                                <div class="login-input-content" style="width: 72%;">
                                <input type="text" id="captcha" class="form-control" autocomplete="off"
                                       placeholder="请输入验证码" name="captcha" required>
                                    <span class="login-icon"><i class="fab fa-black-tie"></i></span>
                                </div>
                                <img src="#(CPATH)/commons/captcha" id="captcha-img" style="height: 34px;margin-top: 2px;border-radius: 3px;margin-left: 3px"
                                     onclick="this.src='#(CPATH)/commons/captcha?d='+Math.random();" cdn-exclude>
                            </div>
                        </div>
                        #end


                        <div style="margin-top:30px;">
                            <div class="form-group">
                                <div class="col-12" style="padding: 0;">
                                    <button type="submit" class="btn btn-primary btn-block btn-flat"> 登 录</button>
                                </div>
                            </div>
                        </div>


                    </form>

                </div>
                <!-- /.login-card-body -->
            </div>
        </div>
        <!-- /.login-box -->

    </div>

</div>



<script src="#(CPATH)/static/components/jquery/jquery.min.js"></script>
<script src="#(CPATH)/static/components/jquery/jquery.form.min.js"></script>
<script src="#(CPATH)/static/components/jquery-validation/jquery.validate.min.js"></script>
<script src="#(CPATH)/static/components/jquery-validation/additional-methods.min.js"></script>
<script src="#(CPATH)/static/components/jquery-validation/localization/messages_zh.min.js"></script>
<script src="#(CPATH)/static/components/bootstrap/js/bootstrap.bundle.min.js"></script>

<script src="#(CPATH)/static/admin/js/jpressutils.js"></script>
<script src="#(CPATH)/static/admin/js/jpressadmin.js"></script>
<script>
    function loginFail(result) {
        showErrorMessage(result.message);
        $('#captcha').val('');
        $('#captcha-img').attr('src',"#(CPATH)/commons/captcha?id="+Math.random())

        if (result.errorCode == 11){
            $('input[name="account"]').val('')
            $('input[name="pwd"]').val('')
        }else if (result.errorCode == 12){
            $('input[name="pwd"]').val('')
        }
    }
</script>

</body>
</html>

